package com.cuitrip.apiservice;

import com.alibaba.fastjson.TypeReference;
import com.cuitrip.apiservice.model.ApiManager;
import com.cuitrip.business.search.model.HotSearch;
import com.cuitrip.business.search.model.HotWord;
import com.cuitrip.business.search.model.HotWordListResponse;
import com.lab.network.model.CtApiRequest;
import com.lab.network.model.CtRemoteBusiness;
import com.lab.network.model.ParseType;
import com.lab.network.proxy.ApiProxy;


public class SearchBusiness {


    public static void getHotWordList(ApiProxy apiProxy) {
        CtApiRequest ctApiRequest = new CtApiRequest();
        ctApiRequest.setApiName(ApiManager.GET_HOT_SEARCH);
        CtRemoteBusiness ctRemoteBusiness = new CtRemoteBusiness(ctApiRequest);
        apiProxy.postAsync(ctRemoteBusiness, new ParseType(new TypeReference<HotWordListResponse<HotWord>>() {
        }.getType()));
    }


    public static void getHotDestinationList(ApiProxy apiProxy) {
        CtApiRequest ctApiRequest = new CtApiRequest();
        ctApiRequest.setApiName(ApiManager.GET_HOT_DESTINATION);
        CtRemoteBusiness ctRemoteBusiness = new CtRemoteBusiness(ctApiRequest);
        apiProxy.postAsync(ctRemoteBusiness, new ParseType(HotSearch.class));
    }

}
